GLib added one-shot variants of the idle/timeout functions a while ago.
While they don't save a lot of code, they serve as a clear marker that
the callback is only invoked once.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3947>
}
}
-static gboolean
+static void
synchronize_size_cb (gpointer user_data)
{
NaXembed *xembed = user_data;
na_xembed_synchronize_size (xembed);
priv->resize_id = 0;
-
- return G_SOURCE_REMOVE;
}
static void
priv->have_size = TRUE;
mtk_x11_error_trap_pop (xdisplay);
- priv->resize_id = g_idle_add (synchronize_size_cb, xembed);
+ priv->resize_id = g_idle_add_once (synchronize_size_cb, xembed);
}
static gboolean
priv->root_y = y;
if (priv->resize_id == 0)
- priv->resize_id = g_idle_add (synchronize_size_cb, xembed);
+ priv->resize_id = g_idle_add_once (synchronize_size_cb, xembed);
}
MetaX11Display *